package com.dhemery.mack.application;

import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchAdvisor;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;

import com.dhemery.mack.gui.WritingPerspective;
import com.dhemery.mack.model.Folder;
import com.dhemery.mack.model.Project;
import com.dhemery.mack.model.Session;


public class MackWorkbenchAdvisor extends WorkbenchAdvisor {
	private final Session session;

	public MackWorkbenchAdvisor() {
		session = new Session();
		Project project = new Project();
		project.addNode(new Folder("Manuscript"));
		project.addNode(new Folder("Plan"));
		project.addNode(new Folder("Research"));
		session.addNode(project);
	}

    @Override
	public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
        return new MackWorkbenchWindowAdvisor(configurer);
    }

    @Override
    public IAdaptable getDefaultPageInput() {
    	return session;
    }

	@Override
	public String getInitialWindowPerspectiveId() {
		return WritingPerspective.ID;
	}
}
